import axios from "./index";
import type { Ref } from "vue";
//获取秒杀列表
export function getseckilllist() {
  return axios.get("/pro/seckilllist");
}
//获取商品列表
export function getList(count: Ref<number>, limitNum: Ref<number>) {
  return axios.get("/pro/list", {
    params: {
      count,
      limitNum,
    },
  });
}
//获取轮播图数据
export function getSwiper() {
  return axios.get("/banner/list");
}

//获取购物车数据
export function getGoodsList(data: getgoodslist) {
  return axios.post("/cart/list", data);
}

//获取产品详情
export function getDetail(data: getdetail) {
  return axios.get(`/pro/detail/${data.proid}`, {
    params: {
      proid: data.proid,
    },
  });
}
//添加购物车
export function setAddCar(data: setaddcar) {
  return axios.post("/cart/add", data);
}

//获取推荐列表
export function recommendList() {
  return axios.get("/pro/recommendlist");
}

//获取购物车数据
export function GoodsList(data: getgoodslist) {
  return axios.post("/cart/list", data);
}
//删除购物车单条
export function removeCar(data: removecar) {
  return axios.post("/cart/remove", data);
}
//更新购物车数量
export function upDateNum(data: updatenum) {
  return axios.post("/cart/updatenum", data);
}
//更改单条购物车选中状态
export function selectOne(data: selectone) {
  return axios.post("/cart/selectone", data);
}
//更改全部购物车选中状态
export function selectAll(data: selectall) {
  return axios.post("/cart/selectall", data);
}
//清空购物车
export function removeCarAll(data: getgoodslist) {
  return axios.post("/cart/removeall", data);
}
